package Demo2;

public class Demo11 {
    public static void main(String[] args) throws InterruptedException {
        Thread t=new Thread(()->{
            for (int i = 0; i <5 ; i++) {
                System.out.println("hello threa");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
t.start();
        t.join(6000);
        System.out.println("main线程结束");

    }
}
